import React, { memo, ReactNode, FC, useEffect } from "react";
import NavBar from "./c-cpns/nav-bar";
import { Outlet } from "react-router-dom";
import { useAppDispatch } from "@/stores";
import { fetchBannersDateAction } from "./c-views/recommend/store";

interface IProps {
  children?: ReactNode;
}

const Discover: FC<IProps> = memo((props) => {
  const dispatch = useAppDispatch();
  useEffect(() => {
    dispatch(fetchBannersDateAction());
  }, []);
  return (
    <div>
      <NavBar />
      <Outlet />
    </div>
  );
});

export default Discover;
